const CarInfo = 'uniapp-car-info-goods'
const UserInfo = 'uniapp-user-info-addr'
const UserAddrInfo = 'uniapp-user-addr-info'
const goodsPriceTotal = 'uniapp-goods-price-total'
const goodsCountTotal = 'uniapp-goods-count-total'
const checkedGoodsCount = 'uniapp-checked-goods-count'
const userToken = 'uniapp-user-token'
const userDetailInfo = 'uniapp-user-detail-info'
// 存商品信息到本地
export function setGoodsInfo(value){
  uni.setStorageSync(CarInfo,JSON.stringify(value))
}
// 取商品信息到本地
export function getGoodsInfo(){
  return uni.getStorageSync(CarInfo)
}
// 保存用户的收货信息到本地
export function setUserInfo(addr){
  uni.setStorageSync(UserInfo,JSON.stringify(addr))
}
// 获取用户的收货信息
export function getUserInfo(){
  return uni.getStorageSync(UserInfo)
}
// 清除用户的收货信息
export function removeUserInfo(){
  uni.removeStorageSync(UserInfo)
}
// 存放用户输入的地址信息
export function setUserAddress(addrInfo){
  uni.setStorageSync(UserAddrInfo,JSON.stringify(addrInfo))
}
export function getUserAddress(){
  return uni.getStorageSync(UserAddrInfo)
}
// 存放选中商品的总价格
export function setGoodsPriceTotal(total){
  uni.setStorageSync(goodsPriceTotal,total)
}
// 取选中商品的总价格
export function getGoodsPriceTotal(){
  return uni.getStorageSync(goodsPriceTotal)
}
// 存放选中商品的总数量
export function setGoodsCountTotal(total){
  uni.setStorageSync(goodsCountTotal,total)
}
// 取选中商品总数量
export function getGoodsCountTotal(){
  return uni.getStorageSync(goodsCountTotal)
}
// 存放用户token
 export function setUserToken(token){
   uni.setStorageSync(userToken,token)
 }
// 获取用户token
export function getUserToken(){
  return uni.getStorageSync(userToken)
}
export function removeUserToken(){
  uni.removeStorageSync(userToken)
}
// 存放通过授权获取的用户信息
export function setUserDetailInfo(userInfo){
  uni.setStorageSync(userDetailInfo,JSON.stringify(userInfo))
}
// 获取通过授权获取的用户信息
export function getUserDetailInfo(){
  return uni.getStorageSync(userDetailInfo)
}
export function removeUserDetailInfo(){
  uni.removeStorageSync(userDetailInfo)
}